//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	FieldAttribute.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;

namespace Smart.Common.Entities
{
	/// <summary>
	/// Attribute Field/Class Property mapping
	/// </summary>
	[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
	public sealed class FieldAttribute : Attribute
	{
		public readonly string fieldName;

		/// <summary>
		/// Attribute SharePoint Field/Property mapping
		/// </summary>
		/// <param name="fieldName">SharePoint Field internal name</param>
		public FieldAttribute(string fieldName)
		{
			this.fieldName = fieldName;
		}

		/// <summary>
		/// SharePoint Field internal name
		/// </summary>
		public string FieldName
		{
			get { return fieldName; }
		}

		/// <summary>
		/// SharePoint Field/Property value mapping type
		/// </summary>
		public FieldMappingType MappingType { get; set; }

		/// <summary>
		/// SharePoint Field/Property value mapping direction
		/// </summary>
		public FieldMappingDirection Direction { get; set; }
	}
}